<?php

function transactionOpen(){
	
	$dbUser = 'cookbook';
	$dbPassword = 'cookbook';
	$dbName = 'cookingtables';
	$dbServer = 'localhost';
	
	$GLOBALS["dbLink"] = mysql_connect($dbServer,$dbUser,$dbPassword);
	mysql_select_db($dbName,$GLOBALS["dbLink"]);
	mysql_query("begin");

}

function transactionClose(){
	
	if (mysql_error()) {
		mysql_query("rollback");
		mysql_close($GLOBALS["dbLink"]);
		redirectError("problems with data base connection");
	}
	else {
		mysql_query("commit");
		mysql_close($GLOBALS["dbLink"]);
	}
	
}


?>